package routers

import (
	beego "github.com/beego/beego/v2/server/web"
	"planet/controllers"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	// 提问
	beego.Router("/question/ask", &controllers.QuestionController{}, "post:Ask")

	// 文件上传
	beego.Router("/upload", &controllers.QuestionController{}, "post:Upload")

	// 问题分类接口
	beego.Router("/question/type", &controllers.QuestionController{}, "get:QuestionType")

	// 问题列表接口
	beego.Router("/question/list", &controllers.QuestionController{}, "get:List")

	// 问题详情
	beego.Router("/question/info", &controllers.QuestionController{}, "get:Info")

	// 回答问题
	beego.Router("/answer/add", &controllers.AnswerController{}, "post:Add")

	// 查找问题下的答案
	beego.Router("/question/answer", &controllers.QuestionController{}, "get:Answers")

}
